 |
|
 |
Subject: PopUp with Excel file upload on Web. |
 |
 |
 |
Product Area: Designer Client |
 |
Technical Area: Application development |
 |
Platform: ALL |
 |
Release: 8.0.2 |
 |
Reproducible: Always |
 |
 |
 |
 |
Hey there!
I was developing a web application and then I find a big problem.
I have an agent that import some information of Excel's sheet and create documents for each line. On Client the agent runs perfectly, but at the web...
What I've tried to do: Create a pop up window that contains a field which gets the xls file and consume the information to generate the docs. The idea is so amazing but it doesn't work in real...
My agent doesn't work at web and I don't know why. I turned on the debug and I got no errors. I've put some messagebox at the code to see the erros on sever console when the agent runs at web and I got nothing to. Even the F12 developers tools at IE I turned on and nothing happened. The only thing I have is AGENT DONE or THE PAGE CANNOT BE DISPLAYED.
Could you help to find where I got wrong?!
I'll put the codes (javascript and lotusscript) below.
Thanks for advance and sorry for my english (I'm Brazialian!)
LOTUSSCRIPT:
Option Public
%REM
Agent MediaSemana
Created May 18, 2012 by Gabrielle Souza/4SR
Description: Comments for Agent
%END REM
Sub Initialize
On Error Goto erro
Dim s As New NotesSession
Dim dbCur As NotesDatabase
Dim excel As Variant
MsgBox "Entrou no agente de importação"
Set dbCur = s.CurrentDatabase
Set excel = CreateObject("Excel.Application")
excel.workbooks.Open("C:\migracoes.xls")
Print |<script language=""Javascript"" type=""text/javascript"">|
Print|var path=window.location.pathname.substring(0,window.location.pathname.toLowerCase().indexof(".nsf")+4);|
Print |alert("Iniciando a Importação")|
MsgBox "iniciando a importaçao"
With Excel.ActiveSheet
k=1
Do Until .Cells(k, 1).Value = ""
Set doc = New NotesDocument(dbCur)
doc.Form = "Cadastro de migracao"
doc.deployment = .Cells(k, 1).Value
doc.ad_time = .Cells(k, 2).Value
doc.firstname = .Cells(k, 3).Value
doc.LastName = .Cells(k, 4).Value
doc.domain = .Cells(k, 5).Value
doc.notes_server = .Cells(k, 6).Value
doc.notes_hierarchical = .Cells(k, 7).Value
doc.nt_sam_account = .Cells(k, 8).Value
doc.site_location = .Cells(k, 9).Value
doc.machine_name = .Cells(k, 10).Value
doc.machine_type = .Cells(k, 11).Value
doc.drive_mappings = .Cells(k, 12).Value
doc.blend_name = .Cells(k, 13).Value
doc.blend_type = .Cells(k, 14).Value
Call doc.Save(True,False)
k = k+1
Loop
End With
Print |<script language=""Javascript"" type=""text/javascript"">|
Print|var path=window.location.pathname.substring(0,window.location.pathname.toLowerCase().indexof(".nsf")+4);|
Print |alert("Terminada a Importação")|
MsgBox "final da importacao"
Exit Sub
erro:
Msgbox "Erro: " & Error & " na linha " & Erl
End
End Sub
JAVASCRIPT:
function importar() {
alert("Para que sejam importadas as migrações é necessário que o arquivo Excel esteja na pasta 'C:\\' , com o nome de 'migracoes.xls'");
var url = path + "/ImportaMigracoes?OpenAgent" + "&1";
form.Return.value = "["+ url + "]";
form.submit();
alert("Importação realizada com sucesso!");
}
 
Feedback number WEBB8ULRRS created by ~Arnold Cisaly on 05/24/2012


PopUp with Excel file upload on Web... (~Arnold Cisaly 24.May.12)
. . Upload to server? (~George Dwofree... 4.Jun.12)
. . First things i would ask... (~Tip Opjipymanl... 24.May.12)
. . . . yES (~Arnold Cisaly 25.May.12) |
|  |
|